package me.zhengjie.modules.location.service;

import me.zhengjie.base.PageInfo;
import me.zhengjie.base.CommonService;
import me.zhengjie.modules.location.domain.Location;
import me.zhengjie.modules.location.service.dto.LocationDto;
import me.zhengjie.modules.location.service.dto.LocationQueryParam;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Set;

/**
* @author TianI
* @date 2022-01-28
*/
public interface LocationService extends CommonService<Location>  {

    static final String CACHE_KEY = "location";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<LocationDto>
    */
    PageInfo<LocationDto> queryAll(LocationQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<LocationDto>
    */
    List<LocationDto> queryAll(LocationQueryParam query);

    Location getById(Long id);
    LocationDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    int insert(LocationDto resources);
    int updateById(LocationDto resources);
    int removeById(Long id);
    int removeByIds(Set<Long> ids);

    List<Location> getLocation(Long id);


    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<LocationDto> all, HttpServletResponse response) throws IOException;
}
